﻿using System;
using System.Text;

namespace SharePhone.Utility
{
    public class SPUtility
    {
        public static string CreateISO8601DateTimeFromSystemDateTime(DateTime dtValue)
        {
            var builder = new StringBuilder();
            builder.Append(dtValue.Year.ToString("0000"));
            builder.Append("-");
            builder.Append(dtValue.Month.ToString("00"));
            builder.Append("-");
            builder.Append(dtValue.Day.ToString("00"));
            builder.Append("T");
            builder.Append(dtValue.Hour.ToString("00"));
            builder.Append(":");
            builder.Append(dtValue.Minute.ToString("00"));
            builder.Append(":");
            builder.Append(dtValue.Second.ToString("00"));
            builder.Append("Z");
            return builder.ToString();
        }
    }
}